<?php
/** @var  $roles|$role backend\models\RoleForm */

use backend\models\RoleForm;
use yii\helpers\Html;

$this->title = "角色列表";

$this->params['breadcrumbs'][] = Yii::$app->controller->id;

$this->params['breadcrumbs'][] = $this->title;

?>
<div class="table-responsive">
<table class="table">
    <tr>
        <th>名称</th>
        <th>描述</th>
        <th>权限</th>
        <th>操作</th>
    </tr>
    <?php  foreach($roles as $role):?>
    <tr>
        <td><?=$role->name?></td>
        <td><?=$role->description?></td>
        <td><?=RoleForm::getPermissions($role->name)?></td>
        <td><?=Html::a('编辑',['rbac/edit-role','name'=>$role->name],['class'=>'btn btn-info'])?>

            <?=Html::a('删除',['rbac/remove-role','name'=>$role->name],['class'=>'btn btn-warning'])?></td>
    </tr>
    <?php endforeach;?>
</table>
</div>